package com.xmtlxx.system.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.domain.entity.SysWorklog;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.system.domain.bo.SysWorklogBo;
import com.xmtlxx.system.domain.vo.SysWorklogVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 流程日志Mapper接口
 *
 * @author xmtlxx
 * @date 2022-04-24
 */
public interface SysWorklogMapper extends BaseMapperPlus<SysWorklogMapper, SysWorklog, SysWorklogVo> {
    /**
     * 根据条件分页查询流程日志
     *
     * @param sysWorklog 流程日志
     * @return Page SysWorklog
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "d.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<SysWorklogVo> selectPageSysWorklogList(@Param("page") Page<SysWorklog> page,@Param("sysWorklog") SysWorklogBo sysWorklog);

    /**
     * 查询流程日志列表
     *
     * @param sysWorklog 流程日志
     * @return 流程日志集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
//        @DataColumn(key = "deptName", value = "s.dept_id"),
//        @DataColumn(key = "userName", value = "s.create_by")
    })
    List<SysWorklogVo> selectSysWorklogList(@Param("sysWorklog") SysWorklogBo sysWorklog);

    /**
     * 获取待办进程
     * @param bo
     * @return
     */
    SysWorklogVo getNeedWorklog(@Param("sysWorklog") SysWorklogBo bo);

    /**
     * 获取经办人
     * @param bo
     * @return
     */
    List<SysWorklogVo> queryWorkOperatores(@Param("sysWorklog") SysWorklogBo bo);

    /**
     *
     * @return
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
//        @DataColumn(key = "deptName", value = "s.dept_id"),
//        @DataColumn(key = "userName", value = "s.create_by")
    })
    Map<String,Object> selectDayCounts(@Param("sysWorklog") SysWorklogBo bo);

}
